package com.hzncc.flowable_diboot.vo.invoicemanage;

import com.diboot.core.binding.annotation.BindDict;
import com.diboot.core.binding.annotation.BindEntity;
import com.diboot.core.binding.annotation.BindField;
import com.diboot.core.vo.LabelValue;
import com.diboot.iam.entity.IamUser;
import com.hzncc.flowable_diboot.delivery.entity.DeliveryProduct;
import com.hzncc.flowable_diboot.delivery.vo.DeliveryProductDetailVO;
import com.hzncc.flowable_diboot.entity.invoicemanage.InvoiceProduct;
import com.hzncc.flowable_diboot.entity.invoicemanage.InvoiceRegister;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * @Description :
 * @Date : 2025/2/12
 * @Author : ChenJin
 * @Version : v1.0.0
 **/
@Getter
@Setter
@Accessors(chain = true)
public class InvoiceFormVO extends InvoiceRegister {

    /**
     * 是否登记 关联字典选项
     */
    @BindDict(type = "yesNo", field = "registered")
    private String registeredLabel;

    /**
     * 销售组织 关联字典选项
     */
    @BindDict(type = "salesGroup", field = "salesOrganization")
    private String salesOrganizationLabel;

    /**
     * 是否收款完成 关联字典选项
     */
    @BindDict(type = "yesNo", field = "paymentCompleted")
    private String paymentCompletedLabel;

    /**
     * 开票类型
     */
    @BindDict(type = "invoiceCategory",field = "invoiceCategory")
    private String invoiceCategoryLabel;

    /**
     * 发票类型 字典信息
     */
    @BindDict(type = "invoiceType", field = "invoiceType")
    private String invoiceTypeLabel;

    /**
     * 领取人 关联信息
     */
    @BindField(entity = IamUser.class, field = "realname", condition = "this.claimant = id")
    private String claimantLabel;

    @BindField(
            entity = IamUser.class,
            field = "userNum",
            condition = "this.claimant = id"
    )
    private String claimantNo;


    /**
     * 收件人 关联信息
     */
    @BindField(entity = IamUser.class, field = "realname", condition = "this.sender = id")
    private String senderLabel;

    @BindField(
            entity = IamUser.class,
            field = "userNum",
            condition = "this.sender = id"
    )
    private String senderNo;

    /**
     * 回执类型 关联信息
     */
    @BindDict(type = "receiptType", field = "receiptType")
    private String receiptTypeLabel;

    /**
     * 开票登记管理和合同项目信息
     */
    @BindEntity(entity = InvoiceProduct.class, condition = "this.id = invoice_register_id",deepBind = true)
    private InvoiceProductListVO product;
    
}
